<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      * {
        margin: 0;
        padding: 0;
      }
      html {
        perspective: 800px;
      }
      .cube {
        width: 200px;
        height: 200px;
        margin: 100px auto;

        position: relative;
        animation: cuberun 2s infinite linear;
        /* 设置3D变形效果 */
        transform-style: preserve-3d;
      }
      .cube:hover {
        animation-play-state: paused;
      }
      .cube > div {
        height: 200px;
        width: 200px;
        /* 为元素设置透明效果 */
        opacity: 0.7;
        position: absolute;
      }
      img {
        /* 取消照片间距离 */
        vertical-align: top;
      }
      .forward {
        transform: rotateY(0deg) translateZ(100px);
      }
      .backward {
        transform: rotateY(180deg) translateZ(100px);
      }
      .left {
        transform: rotateY(-90deg) translateZ(100px);
      }
      .right {
        transform: rotateY(90deg) translateZ(100px);
      }
      .top {
        transform: rotateX(90deg) translateZ(100px);
      }
      .bottom {
        transform: rotateX(-90deg) translateZ(100px);
      }
      @keyframes cuberun {
        from {
          transform: rotateX(0) rotateY(0deg);
        }
        to {
          transform: rotateX(360deg) rotateY(360deg);
        }
      }
    </style>
  </head>
  <body>
    <div class="cube">
      <div class="forward">
        <img src="./img/14/6.jpg" alt="" />
      </div>
      <div class="backward">
        <img src="./img/14/1.jpg" alt="" />
      </div>
      <div class="left">
        <img src="./img/14/3.jpg" alt="" />
      </div>
      <div class="right">
        <img src="./img/14/4.jpg" alt="" />
      </div>
      <div class="top">
        <img src="./img/14/5.jpg" alt="" />
      </div>
      <div class="bottom">
        <img src="./img/14/2.jpg" alt="" />
      </div>
    </div>
  </body>
</html>
